/*
* note : use MXML_TEXT_CALLBACK when call mxmlLoadFile
*/

#ifndef tool_mxml_h
#define tool_mxml_h

#include "tool.h"

int tmxmlIsElement(mxml_node_t *Element, char const *String);
void tmxmlElementReadChildText(mxml_node_t *Element, char *Buf);
int tmxmlElementReadChildInt(mxml_node_t *Element);
float tmxmlElementReadChildFloat(mxml_node_t *Element);

void tmxmlReadStringTable(mxml_node_t *Bouy, std::vector<std::string> *Table, char const *Key);
void tmxmlReadIntTable(mxml_node_t *Bouy, std::vector<int> *Table, char const *Key);
void tmxmlReadFloatTable(mxml_node_t *Bouy, std::vector<float> *Table, char const *Key);
void tmxmlReadCGPointTable(mxml_node_t *Bouy, std::vector<CGPoint> *Table);

void tmxmlReadIntArray(mxml_node_t *Bouy, int *Array, char const *Key);

void tmxmlNodeAddIntChild(mxml_node_t *Element, char const *Key, int Data);
void tmxmlNodeAddIntArray(mxml_node_t *Bouy, int *Array, int Size, char const *key, char const *SubKey);

char const *tmxmlCallBackXmlWhitespace(mxml_node_t *Node, int Where);
int tmxmlNodeGetParentCount(mxml_node_t *Node);

#endif